package com.evl.refundRule.service.impl;

import java.text.ParseException;
import java.util.Date;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.evl.common.persistence.dao.RefundRuleMapper;
import com.evl.common.persistence.model.RefundRule;
import com.evl.refundRule.service.IRefundRuleService;
import com.evl.utils.DateUtils;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author yangliwei
 * @since 2017-07-12
 */
@Service
public class RefundRuleServiceImpl extends ServiceImpl<RefundRuleMapper, RefundRule> implements IRefundRuleService {

	@Resource
	RefundRuleMapper refundRuleMapper;
	
	@Override
	public RefundRule selectfundRule(String depTime) {
		long days =0;
		try {
			days = DateUtils.getDifferenceDays(DateUtils.getSpecifyDate(new Date(),DateUtils.FORMAT_YYYY_MM_DD_HH_MM_SS),depTime);
		} catch (ParseException e) {
			e.printStackTrace();
		}
		RefundRule refundRule = refundRuleMapper.selectByDays(days);
		
		return refundRule;
	}
	
}
